//
//  Assets+Theme.swift
//  SwiftCode
//
//  Created by yuhus on 2023/7/25.
//

import UIKit

/// 中性
extension UIColor {
  public static var neutral1: UIColor { .init(hex: 0x1A1A1A) }
  public static var neutral2: UIColor { .init(hex: 0x333333) }
  public static var neutral3: UIColor { .init(hex: 0x666666) }
  public static var neutral4: UIColor { .init(hex: 0x999999) }
  public static var neutral5: UIColor { .init(hex: 0xB3B3B3) }
  public static var neutral6: UIColor { .init(hex: 0xCCCCCC) }
  public static var neutral7: UIColor { .init(hex: 0xD9D9D9) }
  public static var neutral8: UIColor { .init(hex: 0xE6E6E6) }
  public static var neutral9: UIColor { .init(hex: 0xF0F0F0) }
  public static var neutral10: UIColor { .init(hex: 0xF6F6F6) }
}

/// 辅助色
extension UIColor {
  public static var secondary1: UIColor { .init(hex: 0xB1FF45) } // 绿
  public static var secondary2: UIColor { .init(hex: 0xFF5F42) } // 红
  public static var secondary3: UIColor { .init(hex: 0x4AB4FF) } // 蓝
  public static var secondary4: UIColor { .init(hex: 0xB884FF) } // 紫
}

// MARK: - 基础颜色
/// 主题色 活力黄
extension UIColor {
  public static var accent: UIColor { .init(hex: 0xFFEF30) }
}

extension UIFont {
  fileprivate class Pin {}
  
  public enum MetaWeight: String {
    case black = "Black"
    case semiBold = "SemiBold"
    case bold = "Bold"
    case extraBold = "ExtraBold"
    case light = "Light"
    case medium = "Medium"
    case regular = "Regular"
    
    func metaWeightName(for fontName: String) -> String {
      "\(fontName)-\(rawValue)"
    }
    
    var weight: UIFont.Weight {
      switch self {
      case .semiBold: return .semibold
      default: return .regular
      }
    }
  }
  
  public static func poppinsFont(ofSize size: CGFloat, weight: MetaWeight = .regular) -> UIFont {
    return .systemFont(ofSize: size, weight: weight.weight)
  }
}
